home *** CD-ROM | disk | FTP | other *** search
- /*
- ** Apple Macintosh Developer Technical Support
- **
- ** File: Start.c
- ** Written by: Eric Soldan
- **
- ** Copyright © 1989-1991 Apple Computer, Inc.
- ** All rights reserved.
- */
-
-
-
- /*****************************************************************************/
-
-
-
- #include "App.h" /* Get the application includes/typedefs, etc. */
- #include "App.Common.h" /* Get the stuff in common with rez. */
- #include "App.protos.h" /* Get the prototypes for application. */
-
- #ifndef __TOOLUTILS__
- #include <ToolUtils.h>
- #endif
-
-
-
- /*****************************************************************************/
-
-
-
- #ifndef THINK_C
- extern void _DataInit();
- #endif
-
-
-
- /*****************************************************************************/
- /*****************************************************************************/
-
-
-
- #pragma segment Main
- void main(void)
- {
- NamesTableEntry appNTE;
- EntityName appEntityName;
- OSErr atErr;
-
- #ifndef THINK_C
- UnloadSeg((Ptr)_DataInit); /* Note that _DataInit can't be in Main! */
- #endif
-
- SetApplLimit(GetApplLimit() - 16384);
- /* This decreases the application heap by 16k, which in turn
- ** increases the stack by 16k. */
-
- MaxApplZone(); /* Expand the heap so code segments load at the top. */
-
- Initialize(1, kMinHeap, kMinSpace, nil, nil); /* Initialize the program. */
-
- DoSetResCursor(watchCursor); /* Rest of startup may take a while. */
-
- ATInit();
- InitRequiredAppleEvents();
- InitConnectAppleEvents();
- InitCustomAppleEvents();
-
- DoAdjustMenus();
-
- StartDocuments(); /* Open (or print) designated documents. */
-
- UnloadSeg((Ptr)Initialize); /* Initialize can't be in Main! */
-
- atErr = AddPPCNBPAlias(&appNTE, "\pDTS.Chat", &appEntityName);
- /* It is okay to use a constant string ID here, as this is never seen by the user. */
-
- EventLoop(); /* Call the main event loop. */
-
- if (!atErr) RemoveNBPAlias(&appEntityName);
-
- ExitToShell(); /* Quit the application. */
- }
-
-
-
-